import request from '@/utils/request'

export function fetchList(query) {
  return request({
   // url: '/vue-element-admin/article/list',
   // ul:'http://192.168.110.192:5000/api/private/v1/cases',
    url:'/cases',
    method: 'get',
    params: query
  })
}

export function delectData(id) {
  return request({
    url: '/cases',
    method: 'delete',
    params: { id }
  })
}

export function fetchArticle(id) {
  return request({
    url: '/vue-element-admin/article/detail',
    method: 'get',
    params: { id }
  })
}

// export function fetchPv(pv) {
//   return request({
//     url: '/vue-element-admin/article/pv',
//     method: 'get',
//     params: { pv }
//   })
// }

export function createArticle(data) {
  return request({
    url: '/cases',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: '/cases',
    method: 'patch',
    data
  })
}
